package cn.zhuo.knowledge.util.fastjson.format;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONWriter;

import java.util.Map;

/**
 * <p>
 *
 * @author z2huo
 */
class JsonFormatTest {

    public static void main(String[] args) {
        String json = """
                {
                    "name": "zyz",
                    "age": 12
                }
                """;
        System.out.println(JSON.toJSONString(json));


        Map<String, Object> map = Map.of("name", "zyz", "age", 12);
        System.out.println();
        System.out.println(JSON.toJSONString(map));
        System.out.println();
        System.out.println(JSON.toJSONString(map, JSONWriter.Feature.PrettyFormat));
    }

}
